#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    string replaceSpaces(string& str) {
        string ret;
        for (char c : str)
        {
            if (c == ' ') ret += "%20";
            else ret += c;
        }
        return ret;
    }
};